package com.china08.yxyapi.api.manage.stu.mystudy.huixue.scoreimprove;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.china08.yxyapi.api.YxyApiBaseController;
import com.china08.yxyapi.model.YxyApiReqModel;
import com.china08.yxyapi.model.YxyApiRespModel;
import com.china08.yxyapi.service.mg.YxyHuixuePlanCrtService;

import io.swagger.annotations.ApiOperation;

/**
 * 首页--创建学习计划
 * 
 */
@CrossOrigin
@RestController
public class YxyHuixuePlanCrtController extends YxyApiBaseController {
    @Autowired
    private YxyHuixuePlanCrtService yxyHuixuePlanCrtService;

    @ApiOperation(value = "成绩提升首页 创建学习计划")
    @ResponseBody
    @RequestMapping(value = "/api_yw/manage/stu/mystudy/huixue/scoreimprove/crt", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public RespModel precess(HttpServletRequest request, HttpServletResponse response,
            @RequestBody(required = false) ReqModel reqModel) {
        return yxyHuixuePlanCrtService.insertYxyHuixuePlan(reqModel);
    }

    public static class ReqModel extends YxyApiReqModel {

        public String studentId;// 学生id

        public String stage;// 学段id

        public String subject;// 学科id

        public String subjectName;// 学科名称

        public String versionId;// 教材版本id

        public String versionName;// 教材版本名字

        public Integer lastScoreType;// 上次考试成绩分值, 100,120,150,180

        public Double lastScore;// 上次考试分数, 小数点后一位

        public String semesterId;// 册别id

        public String semesterName;// 册别名称

        public String bookContentId;// 只能是一级目录, id

        public String bookContentName;// 目录名称(7章节信息。显示创建学习计划时的下次考试范围。)

        public Integer expectScore;// 预期提高分数, 5, 10, 15, 20

        // public Integer beginDate;// 开始时间(8)

        public Integer endDate;// 结束时间(9计算出来?)

    }

    public static class RespModel extends YxyApiRespModel {
        public boolean isExistsOrNot;// 判断这个学生在该学科下是否已存在进行中的计划(0表示不存在,1表示存在)
    }

}
